<div class="content-wrap">
    <div style="clear:both; display:block; height:20px"></div>
    <?php //my_load_intro(); ?>
    <div class="container-2">
        <div style="clear:both; display:block; height:40px"></div>
        <div class="zoom-section">    	  
            <div class="zoom-small-image">
                <a href='<?php echo wpsc_the_product_thumbnail(); ?>' 
                   class='cloud-zoom' id="zoom1" rel="position:'inside',showTitle:false,adjustX:-4,adjustY:-4">
                    <img src="<?php echo wpsc_the_product_thumbnail(); ?>"
                         title="Your caption here" alt=''/>
                </a>
            </div>
            <div class="zoom-desc">
                <p>
                    <?php
                    $id_product_current = wpsc_the_product_id();
                    $mang = $wpdb->get_col("select guid  from wp_posts WHERE post_parent=" . $id_product_current);
                    foreach ($mang as $url) {
                        ?>
                        <a href='<?php echo $url ?>' class='cloud-zoom-gallery' 
                           title='Red' rel="useZoom: 'zoom1', smallImage: '<?php echo $url; ?>' ">
                            <img class="zoom-tiny-image" src="<?php echo $url ?>" alt = "Thumbnail 1"/></a>
                    <?php } ?>
                </p>
            </div>

        </div><!--zoom-section end-->

        <div class="prod-detail">
            <h2><?php echo wpsc_the_product_title(); ?></h2>
            <small><?php echo wpsc_product_normal_price(); ?></small>
            <span class="price"><small><?php echo wpsc_product_normal_price(); ?></small><?php echo wpsc_the_product_price(); ?></span>
            <form action="#">
                Choose you sizes :&nbsp;
                <select>
                    <option>Large</option>
                    <option>Medium</option>
                    <option>Small</option>
                    <option>X-Large</option>
                    <option>X-Small</option>
                </select>
                &nbsp;&nbsp;
                Quantity:&nbsp;
                <input value="1" type="text">
            </form>
            <form class="product_form"   enctype="multipart/form-data" action="<?php echo esc_url($action); ?>" 
                  method="post" name="product_<?php echo wpsc_the_product_id(); ?>" 
                  id="product_<?php echo wpsc_the_product_id(); ?>" >
                <input type="hidden" value="add_to_cart" name="wpsc_ajax_action"/>
                <input type="hidden" value="<?php echo wpsc_the_product_id(); ?>" name="product_id"/>
                <input type="submit"  value="<?php _e('Add To Cart', 'wpsc'); ?>" name="Buy" 
                       class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button"/>
            </form>
            <span class="cart-button">
                <a href="JavaScript:void(0);" onclick="return click_addtocart(<?php echo wpsc_the_product_id(); ?>);">Add to Cart</a>
                <a href="JavaScript:void(0);" onclick=" return setCook_wishlist(<?php echo wpsc_the_product_id(); ?>);">Add to Wishlist</a>
                <a href="JavaScript:void(0);" onclick=" return setCook_compare(<?php echo wpsc_the_product_id(); ?>);">Add to Compare</a>
            </span>
            <div id="tab">
                <ul class="nav">
                    <li class="nav-one"><a href="#details">Details</a></li>
                    <li class="nav-two"><a href="#specs"  class="current">Specification</a></li>
                    <li class="nav-four last"><a href="#tags">Tags</a></li>
                </ul>
                <div class="list-wrap">
                    <ul id="details" class="hide">
                        <li><span>Product Code:</span> Product 01</li>
                        <li><span>Availability:</span><?php if (wpsc_product_has_stock()) {
                        echo 'In Stock';
                    } else {
                        echo 'hết hàng';
                    } ?></li>
                        <li><span>Price:</span><?php echo wpsc_the_product_price(); ?></li>
                        <li><span>Eco Tax:</span> $1</li>
                        <li><span>Vat(10%):</span> $7</li>
                    </ul>
                    <div id="specs">
                        <p>Vivamus orci sem, consectetur ut vestibulum a, semper ac dui. Aenean tellus nisl, commodo eu aliquet ut, pulvinar ut sapien. Praesent sollicitudin, nibh nec mattis lobortis, dui massa eleifend magna, eget consequat risus felis dignissim ligula. </p>
                        <ul>
                            <li><a href="#">Lorem ipsum dolor sit amet Consectetur adipiscing elit</a></li>
                            <li><a href="#">Integer molestie lorem at massa Facilisis in pretium nisl aliquet</a></li>
                            <li><a href="#">Nulla volutpat aliquam velit </a></li>
                        </ul>
                    </div>
                    <ul id="tags" class="hide">
                        <li><a href="#">Office Products</a></li>
                        <li><a href="#">Paper</a></li>
                        <li><a href="#">Breakroom</a></li>
                        <li><a href="#">Furniture</a></li>
                        <li><a href="#">Ink & Toner</a></li>
                        <li><a href="#">Cleaning</a></li>
                    </ul>
                </div>
            </div>
        </div>

            <?php //tới đây  ?>
        <!--prodetail-->
        <div class="relatedprod">
            <h4>Related Products</h4>
            <?php
            //lấy sản phẩm liên quan
            $catarogy_current_id_array = $wpdb->get_row
                    ("SELECT slug FROM wp_terms,wp_term_relationships WHERE term_id=term_taxonomy_id AND object_id=" . $id_product_current);
            $myposts = my_product_with_categoty($id_product_current, $catarogy_current_id_array);
            foreach ($myposts as $post) : setup_postdata($post);
                if (wpsc_the_product_id() == $id_product_current)
                    continue;
                ?>
                <form class="product_form"   enctype="multipart/form-data" action="<?php echo esc_url($action); ?>" 
                      method="post" name="product_<?php echo wpsc_the_product_id(); ?>" 
                      id="product_<?php echo wpsc_the_product_id(); ?>" >
                    <input type="hidden" value="add_to_cart" name="wpsc_ajax_action"/>
                    <input type="hidden" value="<?php echo wpsc_the_product_id(); ?>" name="product_id"/>
                    <input type="submit"  value="<?php _e('Add To Cart', 'wpsc'); ?>" name="Buy" 
                           class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button"/>
                </form>
                <div class="entry">
                    <div class="da-thumbs">
                        <div class="div-related"> <img src="<?php echo wpsc_the_product_thumbnail(); ?>" alt="">
                            <article class="da-animate da-slideFromRight" style="display: block;">
                                <p> <a href="<?php echo $post->guid; ?>" class="link tip" title="View Detail"></a>&nbsp;
                                    <a href="JavaScript:void(0);" onclick="return click_addtocart(<?php echo wpsc_the_product_id(); ?>);" 
                                       class="cart tip" title="Add to cart"></a>&nbsp;&nbsp;
                                    <a href="JavaScript:void(0);" onclick=" return setCook_wishlist(<?php echo wpsc_the_product_id(); ?>);"  
                                       class="zoom tip" title="Add to Wishlist" ></a>
                                </p>
                            </article>
                        </div>
                    </div>
                    <h3>
                        <a href="<?php echo $post->guid; ?>">
    <?php echo wpsc_the_product_title(); ?>
                        </a>
                    </h3>
                    <span>
                <?php echo wpsc_the_product_price(); ?>
                    </span> 
                </div>      
    <?php
    //the end lấy sản phẩm 
endforeach;
?>
        </div>
    </div>
    <!--end:container-2--> 